package it.xiuxian.lib.utils

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.DecodeFormat
import com.bumptech.glide.request.RequestOptions
import com.youth.banner.loader.ImageLoader


class GlideRoundImageLoader : ImageLoader() {

    override fun displayImage(context: Context?, path: Any?, imageView: ImageView?) {
        imageView!!.scaleType = ImageView.ScaleType.FIT_XY
        Glide.with(context!!).load(path).fitCenter().apply(optionsRound).into(imageView!!)
    }
    companion object{
      val optionsRound = (RequestOptions()).format(DecodeFormat.PREFER_ARGB_8888).transform(
          GlideRoundTransformCenterCrop(20)
      )
    }
}